package chapter03.test;

public class Car {
    //成员变量
    private String brand;
    private String type;
    private double price;

    //构造方法
    public Car() {
    }

    public Car(String brand, String type, double price) {
        this.brand = brand;
        this.type = type;
        this.price = price;
    }

    //成员方法
    public void moveForword() {
        System.out.println("move Forword");
    }

    public void moveBackword() {
        System.out.println("move Backword");

    }

    // 封装
    public String getBrand() {
        return brand;
    }

    public void setBrand(String brand) {
        this.brand = brand;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public double getPrice() {
        return price;
    }

    public void setPrice(double price) {
        this.price = price;
    }
}
